//
//  WSCoinRecordsCell.m
//  BaseProject
//
//  Created by karong on 2023/8/7.
//

#import "WSCoinRecordsCell.h"
#import "WSRecord.h"
#import "NSDate+Time.h"

@interface WSCoinRecordsCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation WSCoinRecordsCell

- (void)setDataWithObject:(WSRecord *)object type:(NSInteger)type {
    if (type == 0) {
        self.titleLabel.text = WSSF(@"%@", object.goods_name);
        self.subTitleLabel.text = WSSF(@"%@", [NSDate dateStringWithMSTimestamp:object.pay_time format:@"MM月dd日 HH:mm"]);
        self.priceLabel.text = WSSF(@"+%ld 剧豆", (long)object.total_coins);
    }
    else {
        self.titleLabel.text = WSSF(@"%@ %@", object.tv_title, object.chapter_title);
        self.subTitleLabel.text = WSSF(@"%@", [NSDate dateStringWithMSTimestamp:object.created format:@"MM月dd日 HH:mm"]);
        self.priceLabel.text = WSSF(@"-%ld 剧豆", (long)object.coins);
    }
    
}

@end
